Skip to content

Remove runtime APIs deprecated for ReScript 13 - #8564

Open
cknitt wants to merge 4 commits into
rescript-lang:masterfrom
cknitt:codex/remove-runtime-v13-deprecations
Open

Remove runtime APIs deprecated for ReScript 13#8564
cknitt wants to merge 4 commits into
rescript-lang:masterfrom
cknitt:codex/remove-runtime-v13-deprecations

Conversation

@cknitt

@cknitt cknitt commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove runtime APIs explicitly deprecated for removal in ReScript 13:
    • the Char module
    • unsafe Obj operations
    • legacy Pervasives helpers
    • Array.unsafe_get
  • Migrate runtime, Belt, documentation examples, and tests to supported APIs.
  • Regenerate runtime JavaScript and artifact manifests.

Obj.magic and Array.getUnsafe remain available.

Motivation

These APIs were scheduled for removal in ReScript 13. Removing them now completes that deprecation cycle and updates internal callers to the supported standard-library equivalents.

Validation

  • make test
  • make lib
  • yarn workspace @tests/belt rescript build
  • git diff --check

cknitt added 4 commits August 19, 2026 08:35
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.76%. Comparing base (45f7582) to head (1ae8b42).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8564      +/-   ##
==========================================
- Coverage   75.79%   75.76%   -0.03%     
==========================================
  Files         476      476              
  Lines       62680    62680              
==========================================
- Hits        47506    47489      -17     
- Misses      15174    15191      +17     

see 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Aug 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8564

@rescript/belt

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@8564

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8564

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8564

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8564

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8564

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8564

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8564

commit: 1ae8b42

@cknitt
cknitt marked this pull request as ready for review August 19, 2026 08:28
@tsnobip

tsnobip commented Aug 19, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 1ae8b42656

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tsnobip tsnobip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have one comment, except from that it looks good to me!

return size
})(obj$1, v => push_back(queue, v));
s = hash_mix_int(s, (size$1 << 10) | 0);
s = hash_mix_int(s, (size$1 << 10));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we losing the | 0 part here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source previously used lor(lsl(size, 10), 0). Since x | 0 is a no-op here and JavaScript's << already coerces its operands and returns a signed 32-bit integer, size << 10 has the same behavior. So losing the trailing | 0 is intentional.

return size
}`)(obj, v => push_back(queue, v))
s.contents = hash_mix_int(s.contents, lor(lsl(size, 10), 0)) /* tag */
s.contents = hash_mix_int(s.contents, Int.shiftLeft(size, 10)) /* tag */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we did not replace lor here?

Suggested change
s.contents = hash_mix_int(s.contents, Int.shiftLeft(size, 10)) /* tag */
s.contents = hash_mix_int(s.contents, Int.bitwiseOr(Int.shiftLeft(size, 10), 0)) /* tag */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could preserve the mechanical translation with Int.bitwiseOr(Int.shiftLeft(size, 10), 0), but the bitwiseOr(..., 0) is redundant: Int.shiftLeft already has the required int32 semantics. I simplified it to Int.shiftLeft(size, 10) rather than retaining the no-op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants